/**
 * Created by Administrator on 2017/3/15 0015.
 */
var PageSub0={
    create:function () {
        var page={};
        var tw_t0,tw_t1,tw_img
        page.ui = new PIXI.DisplayObjectContainer();

        var gp=new PIXI.Graphics();
        gp.beginFill(0x0);
        gp.drawRect(-740/2,-1136/2,740,1136);
        gp.x=740/2;
        gp.y=1136/2;
        gp.alpha=1;
        page.ui.addChild(gp);

        var img0=new PIXI.Sprite(resource['assets/images/sub_i0.png'].texture);
        img0.x=370;
        img0.y=290;
        img0.alpha=0;
        page.ui.addChild(img0);
        tw_img=TweenMax.to(img0,5,{x:740-img0.width,yoyo:true,repeat:-1});

        var t0=new PIXI.Sprite(resource['assets/images/sub_t0.png'].texture);
        t0.x=370;
        t0.y=963;
        t0.alpha=0;
        t0.anchor.set(0.5);
        page.ui.addChild(t0);
        // console.log(t0.texture.width);

        var t1=new PIXI.Sprite(resource['assets/images/p0_t1.png'].texture);
        t1.x=370;
        t1.y=1018;
        t1.alpha=0;
        t1.anchor.set(0.5);
        page.ui.addChild(t1);

        var bt_close=new PIXI.Sprite(resource['assets/images/bt_close.png'].texture);
        bt_close.x=668;
        bt_close.y=79;
        bt_close.alpha=1;
        bt_close.anchor.set(0.5);
        page.ui.addChild(bt_close);
        bt_close.interactive=true;
        bt_close.on('pointerdown',function () {
            page.ui.parent.removeChild(page.ui);
        })
        
        page.In=function () {
            TweenMax.killTweensOf(img0);
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(bt_close);

            img0.x=0;
            img0.alpha=0;
            TweenMax.to(img0,8,{x:740-img0.width,yoyo:true,repeat:-1,ease:Cubic.easeInOut});
            TweenMax.to(img0,1,{alpha:1});

            t0.x=370+100;
            t1.x=370-100;
            t0.alpha=0
            t1.alpha=0;
            TweenMax.to(t0,1,{delay:0.5,x:370,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t1,1,{delay:0.5,x:370,alpha:1,ease:Cubic.easeInOut});

            bt_close.scale.x=bt_close.scale.y=0;
            TweenMax.to(bt_close.scale,1,{delay:1,x:1,y:1,ease:Back.easeOut});

        }

        return page
    }
    
}
